package IO;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("day01\\note.txt");
        System.out.println("请输入字母：");

        while(true){

            String line = sc.nextLine();
            if("exit".equals(line)){
                break;
            }
            fos.write(line.getBytes(StandardCharsets.UTF_8));
        }
        System.out.println("输入完毕");
        fos.close();


    }
}
